<?php
namespace App\Admin\Extensions\Tools;

use Dcat\Admin\Grid\Tools\AbstractTool;

class ExportButton extends AbstractTool
{
    protected $title = '';
    protected $answer_id = '';
    protected $type = '';
    protected $type_title = '';

    public function __construct($title = null, $answer_id = null, $type = null, $type_title = null)
    {
        $this->title = $title;
        $this->answer_id = $answer_id;
        $this->type = $type;
        $this->type_title = $type_title;
    }

    public function render()
    {
        $options = [
            'title' => $this->title,
            'answer_id' => $this->answer_id,
            'type' => $this->type,
            'type_title' => $this->type_title,
        ];

        return view('admin.tools.export', compact('options'));
    }
}